import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { CartService } from '../cart.service';
import { Location } from '@angular/common';
import * as Parse from "parse"

@Component({
  selector: 'app-page-comment',
  templateUrl: './page-comment.component.html',
  styleUrls: ['./page-comment.component.scss']
})
export class PageCommentComponent {

  commentList: any
  constructor(
    private route: ActivatedRoute,
    private router: Router,
    private location: Location,
    private cartServ: CartService
  ) {


    /**
  * Angular的ActivatedRoute服务，实现参数解析
  */
    this.route.queryParams.subscribe(async params => {
      console.log(params + "111")
      let id = params["id"]
      console.log(id + 'id')
      let query = new Parse.Query("comment")
      this.commentList = await query.get(id)
      console.log(this.commentList + "com")
    })

  }

  //返回
    goBack(){
     this.location.back();
      }
}
